/*----------------------------------------------
| noka color select  v1.0 www.97521.com        |
| rebin 2014-01-20                             |
|---------------------------------------------*/
var ncolorSelect = Class.create({
    version: '1.0',
    initialize : function(cfg) {
    	this.cfg = cfg;					//配置信息
    	this.id=cfg.id; //id
    	this.readonly = ('readonly'==cfg.readonly);
    	this.disabled = ('disabled'==cfg.disabled);
    	this.rooturl = cfg.rooturl;
    },
    show : function(){
    	var self = this;
    	 var CP_color = new dhtmlXColorPickerInput(self.id);
    	 CP_color.setImagePath(self.rooturl+'/nokatag/color/file/');
    	 CP_color.init();
    	 CP_color.onshow = function(){
    		if(self.readonly || self.disabled){
    			return false;
    		}
    		return true;
    	 };
    	$(self.id).setDisabled = function(a){
    		$(self.id).writeAttribute({disabled:a});
    		self.disabled = a;
 		};
 		$(self.id).setReadonly = function(a){
 			$(self.id).writeAttribute({readonly:a});
 			self.readonly = a;
 		};
    }
});

